<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

class TRealdataGenAir extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('t_realdata_gen_air', function (Blueprint $table) {
             $table->engine = 'MEMORY';
             $table->charset = 'utf8';
             $table->collation = 'utf8_general_ci';
            // CONTENT
            $table->datetime('rd_updatetime')->nullable(false)->comment('');
			$table->integer('pdi_index')->nullable(false)->default(0)->comment('');
			$table->float('rd_temp_value', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_humi_value', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_GenAirRunStat', 9, 2)->nullable()->default(0)->comment('');
			$table->boolean('rd_temp_high')->nullable()->default(0)->comment('');
			$table->boolean('rd_temp_low')->nullable()->default(0)->comment('');
			$table->boolean('rd_humi_high')->nullable()->default(0)->comment('');
			$table->boolean('rd_humi_low')->nullable()->default(0)->comment('');
			$table->boolean('rd_DevConnection')->nullable()->default(0)->comment('');
			$table->boolean('rd_NetCom')->nullable()->default(0)->comment('');
			$table->unique('pdi_index', 'pdi_index');
			
        });

        
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('t_realdata_gen_air');
    }
}
